import request from '@/utils/request'

// 获取标签数据
export const getTagList = (type) => {
    return request({
        url: '/open/client/sources/tag/list/' + type,
        method: 'get',
        headers: {
            isToken: false
        }
    })
}

// 获取主分类列表
export const getMainCategoryList = () => {
    return request({
        url: '/open/client/sources/category/main/list',
        method: 'get',
        headers: {
            isToken: false
        }
    })
}

// 获取子分类
export const getCategoryList = (pid) => {
    return request({
        url: '/open/client/sources/category/list/' + pid,
        method: 'get',
        headers: {
            isToken: false
        }
    })
}

// 获取资源列表
export const getResourceList = (query) => {
    return request({
        url: '/open/client/sources/list',
        method: 'get',
        params: query,
        headers: {
            isToken: false
        }
    })
}

// 获取资源列表
export const getResourceInfo = (id) => {
    return request({
        url: '/open/client/sources/info/' + id,
        method: 'get',
        headers: {
            isToken: false
        }
    })
}

// 获取资源列表
export const getResourceDetailList = (id) => {
    return request({
        url: '/open/client/sources/detail/list/' + id,
        method: 'get',
        headers: {
            isToken: false
        }
    })
}

// 获取资源播放授权
export const getOpenAuthCode = (id) => {
    return request({
        url: '/open/client/sources/view/code/' + id,
        method: 'get',
        headers: {
            isToken: false
        }
    })
}

// 获取资源播放授权
export const getAuthCode = (id) => {
    return request({
        url: '/sources/surResourceDetail/view/code/' + id,
        method: 'get'
    })
}

// 提交联系我们信息
export const addContactUs = (data) => {
    return request({
        url: '/open/cms/contact/us/add',
        method: 'post',
        data: data
    })
}


